This disclosure relates generally to load balancing in digital systems and, more specifically, to a method and system for load balancing at a network interface card level.
A computer network generally has at least one computer (e.g., a server or gateway) that provides services to other computers (clients) via a network. In an Internet Protocol (IP) network, the server and clients are associated with IP addresses that enable the other computers to send them packets. Address resolution between the server and clients may use an Address Resolution Protocol (ARP), which maps an IP address to a physical machine address.
The server and clients each have at least one network interface card (NIC) or a similar interface through which the incoming (inbound) and outgoing (outbound) traffic is routed. Each NIC has a unique hardware number called a Media Access Control (MAC) address (e.g., a physical machine address) that may be used in conjunction with the IP address to identify a specific communication route to be used for a computer. For example, a server may have multiple NICs and may use a load balancing module to distribute the traffic between the NICs by assigning different communication routes to different clients.
One form of load balancing in an IP network is link level load balancing, which can be achieved on a network by replicating links of the server. Each link provides a connection point or path to the server that may be used for traffic to and from a client. Generally, a server with link level load balancing has multiple NICs on which the inbound and outbound traffic will be distributed, where each NIC serves as a link. When a client sends an ARP request for the server's IP address, the load balancing module on the server responds with a MAC address of one of the NICs, which identifies the specific link to be used. The design of the load balancing module determines which NIC and associated MAC address is selected.
To implement such link level load balancing, the server and clients may each have an ARP cache that is used to maintain entries of each IP-MAC mapping (e.g., the association between each IP and MAC address) belonging to the other computers. The lifetime of each entry is configurable, so each entry may remain valid for a certain period of time before expiring. When an entry in a cache expires, the computer associated with the cache sends an ARP request across the network for the IP address associated with the MAC address of the expired entry. Upon receiving a reply from the computer having the MAC address, ARP updates the cache.
Another way to update the IP-MAC information uses an ARP request and Gratuitous ARP, which involves sending broadcast packets that are received by every computer. On receiving the ARP broadcast request, ARP searches each computer's ARP cache for the source IP address and, upon finding a match, updates the entry with the MAC present in the ARP packet. Therefore, when the server broadcasts the ARP request, all the clients update their ARP cache for the server IP address with the MAC address used by the server in sending the ARP. Accordingly, after every broadcast ARP request generated by the server, the inbound load balancing may be disrupted as all the clients may attempt to communicate with the server via the single NIC used for the broadcast. This results in poor throughput and congestion at the NIC.
Therefore, what is needed is an improved method and system for maintaining load balancing in a computer network. For example, it is desirable that a broadcast ARP request from a server does not cause all clients to update their ARP caches to a single NIC on the server.